#include <QCoreApplication>
#include <MNotification>
#include <qmdevicemode.h>

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);

    MeeGo::QmDeviceMode device;
    MeeGo::QmDeviceMode::DeviceMode mode = device.getMode();
    MNotification notification(MNotification::DeviceEvent);

    if(mode == MeeGo::QmDeviceMode::Flight) {
        device.setMode(MeeGo::QmDeviceMode::Normal);

        if (device.getMode() == MeeGo::QmDeviceMode::Normal) {
            notification.setImage("icon-m-common-gsm");
            notification.setBody("Normal mode activated");
        } else {
            notification.setImage("icon-l-error");
            notification.setBody("Error setting normal mode");
        }

    } else if (mode == MeeGo::QmDeviceMode::Normal) {
        device.setMode(MeeGo::QmDeviceMode::Flight);

        if (device.getMode() == MeeGo::QmDeviceMode::Flight) {
            notification.setImage("icon-m-status-menu-flight-mode");
            notification.setBody("Flight mode activated");
        } else {
            notification.setImage("icon-l-error");
            notification.setBody("Error setting flight mode");
        }
    }

    notification.publish();
}
